﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Text;

namespace Common
{
    public class PBLL
    {
        public class PMenu
        {
            private PDAL.PMenu dal = new PDAL.PMenu();
            public PMenu() { }

            public DataSet GetList(string where)
            {
                return dal.GetList(where);
            }

            public OleDbDataReader GetDr(string where)
            {
                return dal.GetDr(where);
            }

            public PModel.PMenu GetModel(string id)
            {
                return dal.GetModel(id);
            }

            public bool Update(PModel.PMenu model)
            {
                return dal.Update(model);
            }
            public bool Insert(PModel.PMenu model)
            {
                return dal.Insert(model);
            }
        }

        public class PConfig
        {
            private static PDAL.PConfig dal = new PDAL.PConfig();
            public PConfig() { }

            public static PModel.PConfig GetModel()
            {
                return dal.GetModel();
            }

            public bool SetConfig(PModel.PConfig model)
            {
                return dal.SetConfig(model);
            }
        }

        public class PService
        {
            private PDAL.PService dal = new PDAL.PService();
            public PService() { }

            public DataSet GetList(string where)
            {
                return dal.GetList(where);
            }

            public OleDbDataReader GetList()
            {
                return dal.GetList();
            }

            public OleDbDataReader GetDr(string id)
            {
                return dal.GetDr(id);
            }

            public int GetCount(string where)
            {
                return dal.GetCount(where);
            }

            public DataSet GetPageList(int pageSize, int currentPage, string strWhere, string filedOrder)
            {
                return dal.GetPageList(pageSize, currentPage, strWhere, filedOrder);
            }
        }

        public class PAd
        {
            private PDAL.PAd dal = new PDAL.PAd();
            public PAd() { }

            public bool Exists(string where)
            {
                return dal.Exists(where);
            }

            public DataSet GetList(string where)
            {
                return dal.GetList(where);
            }
        }

        public class PShow
        {
            private PDAL.PShow dal = new PDAL.PShow();
            public PShow() { }

            public DataSet GetList()
            {
                return dal.GetList();
            }

            public int GetCount(string where)
            {
                return dal.GetCount(where);
            }

            public DataSet GetPageList(int pageSize, int currentPage, string strWhere, string filedOrder)
            {
                return dal.GetPageList(pageSize, currentPage, strWhere, filedOrder);
            }

            public PModel.PShow GetModel(string id)
            {
                return dal.GetModel(id);
            }

            public bool Update(PModel.PShow model)
            {
                return dal.Update(model);
            }
            public bool Insert(PModel.PShow model)
            {
                return dal.Insert(model);
            }
        }

        public class PLink
        {
            private PDAL.PLink dal = new PDAL.PLink();
            public PLink() { }

            public DataSet GetList()
            {
                return dal.GetList();
            }
        }

        public class PNews
        {
            private PDAL.PNews dal = new PDAL.PNews();
            public PNews() { }

            public DataSet GetList(string where)
            {
                return dal.GetList(where);
            }

            public OleDbDataReader GetDr(string id)
            {
                return dal.GetDr(id);
            }

            public OleDbDataReader GetPageList(int size, int page)
            {
                return dal.GetPageList(size, page);
            }

            public int GetCount()
            {
                return dal.GetCount();
            }

            public DataSet GetPageList(int pageSize, int currentPage, string strWhere, string filedOrder)
            {
                return dal.GetPageList(pageSize, currentPage, strWhere, filedOrder);
            }

            public PModel.PNews GetModel(string id)
            {
                return dal.GetModel(id);
            }

            public bool Update(PModel.PNews model)
            {
                return dal.Update(model);
            }

            public bool Insert(PModel.PNews model)
            {
                return dal.Insert(model);
            }

            public void ExSql(string sql)
            {
                dal.ExSql(sql);
            }
        }

        public class PUsed
        {
            private PDAL.PUsed dal = new PDAL.PUsed();
            public PUsed() { }

            public DataSet GetList()
            {
                return dal.GetList();
            }

            public int GetCount(string where)
            {
                return dal.GetCount(where);
            }

            public DataSet GetPageList(int pageSize, int currentPage, string strWhere, string filedOrder)
            {
                return dal.GetPageList(pageSize, currentPage, strWhere, filedOrder);
            }

            public bool Update(PModel.PUsed model)
            {
                return dal.Update(model);
            }
            public bool Insert(PModel.PUsed model)
            {
                return dal.Insert(model);
            }
        }
    }
}
